package studentmanage.controller;

import studentmanage.DTO.AdminDTO;
import studentmanage.VO.AdminVO;
import studentmanage.service.AdminService;
import studentmanage.tools.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "管理登录")
@RestController
@Slf4j
@RequestMapping("/admin")
public class AdminController {
    @Autowired(required = false)
    AdminService adminService;

    @PostMapping("/login")
    @ApiOperation("管理员登录")
    public Result login(@RequestBody AdminDTO adminDTO) {
        AdminVO adminVO=adminService.login(adminDTO);
        return Result.success(adminVO);
    }

}
